package com.tvsinfo.jdk.demo.case6_higher_order_function;

import java.util.List;
import java.util.Map;
import java.util.function.*;

/**
 * @param <A> 原对象
 * @param <B> 对比对象
 * @param <C> A的转化对象
 * @param <D> B的转化对象
 * @param <R> R结果对象
 */
public class ListMergeCollectors<A, B, C, D, R> {
//    /**
//     * 应用对象
//     */
//    private final Supplier<A> supplier;
//    private final BiConsumer<A, R> accumulator;
//    private final BinaryOperator<A> combiner;
//    private final Function<A, R> finisher;


    private Map<A, List<B>> list;

    public ListMergeCollectors(Map<A, List<B>> list) {
        this.list = list;
    }


    public Map<A, List<B>> toMap() {
        int a=3;

        int b=4;
        if((a&b)==0){

        }
        return list;
    }

//    Map<C, R> toMap(Function<A, C> keyMapper, Function<List<B>, D> valueMapper, BinaryOperator<R> rBinaryOperator) {
//        list.forEach((a, bs) -> {
//                    C c = keyMapper.apply(a);
//                    D d = valueMapper.apply(bs);
//                }
//        );
//
//    }


//    void toList(Function<A, C> keyMapper, Function<B, D> valueMapper, BiPredicate<A, B> filterCondition, BinaryOperator<R> rBinaryOperator) {
//        ListMergeUtils.merge(keyMapper, valueMapper, filterCondition);
//    }
//
//
//    Map<C, R> toMap(Function<A, C> keyMapper, Function<List<B>, D> valueMapper, BinaryOperator<R> rBinaryOperator) {
//        list.forEach((a, bs) -> {
//                    C c = keyMapper.apply(a);
//                    D d = valueMapper.apply(bs);
//                }
//
//        );
//
//        return null;
//    }


    <A, B> void forEachResult(BiConsumer<A, B> abBiConsumer) {

    }


    public static interface Collector {

    }

}
